﻿$(function () {

 

});

function changpassword() {
    var userid = getCookie('userid');
    var ps1 = $('#js_input_pass01').val();
    var ps2 = $('#js_input_pass02').val();
    if (ps1 != ps2) {
        $.alert("密码不一致！", "失败", function () {
        });
        return;
    }

    var password = ps1;
    $.ajax({
        type: "GET",
        url: "http://" + B_Url + "/api/baseInfo",
        data: { info: 'changpassword', id: userid, password: password },
        success: function (result) {
            if (result == 1) {
                login();
            } else {
                $.alert("修改失败！", "失败", function () {
                });
            }
        },
        error: function (e) { }
    });
}

function login() {
    setCookie('user', '');
    setCookie('org', '');
    window.location.href = './login.html';
}